<html>
<head>
    <meta charset="utf-8"/>
    <title>Zadatak 1 - izmena studenta</title>
    <link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div id="content">

    <?php
    if (isset($_POST['indeks'])){
        require_once "Konekcija.php";

        $indeks = $_POST['indeks'];
        $sql = "select * from student where indeks='".$indeks."'";
        if(!$query = $mysqli->query($sql))
            echo "Greska pri izvodjenju upita" . mysql_error();

        $stud = $query->fetch_object();


        ?>

        <a href="studentProfil.php?indeks=<?php echo $indeks?>">Nazad</a>
        <form method="get" action="studentProfil.php">
            <label for="ime">Ime:</label> <input type="text" name="ime" maxlength="30" value="<?php echo $stud->ime?>" required>
            <br>
            <label>Prezime:</label> <input type="text" name="prezime" maxlength="35" value="<?php echo $stud->prezime?>" required>
            <br>
            <input type="hidden" name="indeks" value="<?php echo $indeks?>">
            <input type="submit" value="Pošalji podatke">
        </form>
    <?php
    }
    ?>

</div>
</body>
</html>



